Open
Conversation
433478e to
3259875
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #10 +/- ##
==========================================
+ Coverage 88.22% 88.45% +0.23%
==========================================
Files 14 13 -1
Lines 416 381 -35
==========================================
- Hits 367 337 -30
+ Misses 49 44 -5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR integrates Apple's
swift-configurationpackage into the Breeze Lambda DynamoDB API, replacing direct environment variable access with a more flexible, testable configuration system. The changes modernize configuration management while maintaining backward compatibility with existing environment variables.Key Changes
1. Package Dependencies
File:
Package.swiftswift-configurationpackage dependency (v1.0.0+)Configurationproduct intoBreezeLambdaAPIandBreezeLambdaItemAPItargets2. Configuration Layer Refactor
File:
Sources/BreezeLambdaAPI/BreezeAPIConfiguration.swiftProtocol Enhancement:
APIConfiguringprotocolSendablefor thread-safety and Swift concurrency complianceConfigReader Integration:
Lambda.env()calls withConfigReadersupporting multiple providers:EnvironmentVariablesProvider()- runtime environment variablesFileProvider<JSONSnapshot>- file-based configuration fallbackConfiguration Keys (Strongly-Typed Enum):
_HANDLER- Lambda handler identifierAWS_REGION- AWS region configurationDYNAMO_DB_TABLE_NAME- DynamoDB table nameDYNAMO_DB_KEY- Primary key configurationLOCALSTACK_ENDPOINT- LocalStack endpoint for local developmentBREEZE_DB_TIMEOUT- Database timeout in secondsDynamic dbTimeout:
BREEZE_DB_TIMEOUTenvironment variableCleaner Region Handling:
3. Demo Application Update
File:
Sources/BreezeLambdaItemAPI/BreezeLambdaItemAPI.swiftAPIConfigurationstructConfigReadercombining:Sources/BreezeLambdaItemAPI/Resources/breeze-item-config.json4. Configuration Resources
New File:
Sources/BreezeLambdaItemAPI/Resources/breeze-item-config.jsonDefines all configuration parameters for local development and testing with LocalStack integration.
Benefits
Sendableprotocol compliance for Swift async/await patternsBackward Compatibility
✅ Fully backward compatible - All changes maintain existing behavior:
Testing Recommendations
BREEZE_DB_TIMEOUTdynamic configurationSendableprotocol compliance in concurrent contextsMigration Notes
No migration needed for existing deployments. For teams wanting to leverage the new configuration files:
breeze-item-config.jsonin your Lambda resource directory